package com.liao.furn.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author lzp
 * @version 1.0
 * lzpnb!
 */
//@TableName(value = "furn")
@Data
public class Furn {
    @TableId(type = IdType.AUTO)
    private Integer id;

    @NotEmpty(message = "名字不能为空")
    private String name;

    @NotEmpty(message = "厂商不能为空")
    private String maker;

    @Range(min = 0,message = "价格不能小于0")
    @NotNull(message = "价格不能为空")
    private Double price;

    @Range(min = 0,message = "销量不能小于0")
    @NotNull(message = "销量不能为空")
    private Integer sales;

    @Range(min = 0,message = "库存不能小于0")
    @NotNull(message = "库存不能为空")
    private Integer stock;
}
